This notebook assumes that data exists in a database in the hdf5 format. For instructions how to set up the database with data see [../readme.md].
The IMUs has its local z-axis pointing out of the box, and its local x-axis pointing in the long direction. The IMUs were strapped to the body with the positive local x-direction pointing downwards along the main axis of the segment. The z-axis was approximately pointing outwards from the body, normal to the sagittal plane.
In [1]:
import numpy as np
import matplotlib.pyplot as plt
import nvg.ximu.ximudata as ximudata
%matplotlib notebook
In [2]:
reload(ximudata)
dbfilename = "/home/kjartan/Dropbox/Public/nvg201209.hdf5"
db = ximudata.NVGData(dbfilename);
In [3]:
dbfile = db.hdfFile;
print "Subjects: ", dbfile.keys()
print "Trials: ", dbfile['S5'].keys()
print "IMUs: ", dbfile['S5/B'].keys()
print "Attributes of example trial", dbfile['S5/B'].attrs.keys()
print "Shape of example IMU data entry", dbfile['S5/B/N'].shape
In [5]:
db.plot_imu_data("S12", "D", "RA")
Out[5]:
In [ ]:
print [s for s in dir(db) if s.startswith("get")]
In [3]:
db.get_angle_to_vertical_markers(subject="S4")
Out[3]:
In [ ]:
res = db.apply_to_all_trials(db.get_RoM_angle_to_vertical, {'imu':'LH'},
subjlist=['S4', 'S6'], triallist=['B', 'N'])
In [ ]:
res = db.apply_to_all_trials(db.get_angle_to_vertical_markers, {'imu':'LH'},
subjlist=['S4', 'S6'], triallist=['B', 'N'])
In [ ]: